<!doctype html>
<html lang="en">
<head>
    @include('web.layout.head')
    <link rel="stylesheet" href="{{asset('/css/web/user/prove_release.css')}}">
    <link rel="stylesheet" href="{{asset('/css/web/user/matching_out.css')}}">
    <script src="{{asset('/js/web/frame/jedate/jquery.jedate.js')}}"></script>
    <link rel="stylesheet" href="{{asset('/js/web/frame/jedate/skin/jedate.css')}}">
    <script src="{{asset('/js/web/user/qrcode.js')}}"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
@include('web.layout.header')
@include('web.layout.user_tab')
<div class="base_member_content">
    <div class="w1200">
      @include('web.layout.seller_nav')
      <div class="right fr">
        <div class="marryreal">
          <div class="name" style="height: 40px;border-bottom: 1px dashed #ccc;">
            <span class="goodsfabu">我的配单</span>
          </div>
         <div class="marryreal_add">
            <div class="marryreal_tit fl">请尽快处理你的配单</div>
            <a href="{{url('/member/seller/items/create')}}">+新增配单</a>
         </div>
          <div style="display:none">
            <input type="hidden" name="_scfs" value="ca350fa4d74c3b6d1640990f75488f06"/>
          </div>
          <div class="table list" style="border: 1px solid #e6e6e6;border-bottom:0;">
              <table>
                  <thead>
                    <tr style="border-bottom: 1px solid #e6e6e6;">
                        {{--<th width="40"></th>--}}
                        <th width="160">配单号</th>
                        <th width="200">购买方联系</th>
                        <th width="100">总费用</th>
                        <th width="150">时间</th>
                        <th width="150">状态</th>
                        <th>操作</th>
                    </tr>
                  </thead>
                  <tbody>
                  @if(isset($list) && !empty($list))
                    @foreach($list as $k=>$v)
                        <tr>
                            {{--<td><input type="checkbox" name="id[]" value=""></td>--}}
                            <td>{{$v['item_code']}}</td>
                            <td>{{$v['buyer_phone']}} <br>{{$v['buyer_contact']}}</td>
                            <td style="color:#ff7a00;">¥{{$v['all_total']}} </td>
                            <td>{{date('Y-m-d',strtotime($v['updated_at']))}}<br>{{date('H:i:s',strtotime($v['updated_at']))}}</td>
                            <td>
                                @if($v['orders']['order_status']==1)
                                    已报价
                                @elseif($v['orders']['order_status']==2)
                                    付款完成
                                @elseif($v['orders']['order_status']==3)
                                    已发货
                                @elseif($v['orders']['order_status']==4)
                                    确认完成
                                @elseif($v['orders']['order_status']==5)
                                    已关闭
                                @endif
                            </td>
                            <td>
{{--                                <p class="out" data-id="{{$v['buyer_phone']}}">外发</p>--}}
                                <a href="{{url('/member/seller/items')}}/{{$v['id']}}" class="solve">处理</a>
                            </td>
                        </tr>
                    @endforeach
                  @endif

                  </tbody>
              </table>
          </div>
          <div class="page">
              @include('web.common.paginate', ['page' => $page])
          </div>
        </div>
      </div>
    </div>
</div>
<div class="shadow"></div>
<div class="matching_out">
    <div class="matching_out_top"><h2>配单分发</h2><a class="close_box">×</a></div>
    <div class="matching_out_box">
        <p>方式一&nbsp;:&nbsp;&nbsp;已关联账号&nbsp;&nbsp;<span class="num">18301083026</span>&nbsp;&nbsp;用户登录账号进入买家中心可查看</p>
    </div>
    <div class="matching_out_box">
        <span class="two">方式二&nbsp;:&nbsp;&nbsp;通过配单地址</span>
        <textarea class="website websetnet" id="biao1">http://ejing365.com/city_partner/invitehan?cp_code=tdeaotvs</textarea>
        <span style="color: #087dce;cursor: pointer;" onClick="copyUrl2()">复制</span>
    </div>
    {{--<div class="matching_out_box">--}}
        {{--<p>方式三&nbsp;:&nbsp;&nbsp;通过微信分享<div id="qrcode" class="ewma"></div></p>--}}
    {{--</div>--}}
</div>
@include('web.layout.footer')
<script>
  $(function() {
    $('.out').click(function() {
      $('.shadow').show();
        var buyer_phone=$(this).data('id');
        $('.num').html(buyer_phone);
      $('.matching_out').show();
    });
    $('.close_box').click(function() {
      $('.shadow').hide();
      $('.matching_out').hide();
    })
  })
</script>
<script>
    //分享链接自定义
    var jiathis_config = {
        url: '',
        title: "有福同享，土豪喊你一起注册领福利啦",
        summary:"!"
    }
    function share(url){
        //修改分享链接
        jiathis_config.url = url;

        //原始二维码清空
        $('#qrcode').empty();
        //二维码生成插件
        var webset = document.getElementById("biao1").innerHTML;
        // new QRCode(document.getElementById('qrcode'), webset);

        // 设置参数方式
        var qrcode = new QRCode('qrcode', {
            text: 'your content',
            width: 85,
            height: 85,
            colorDark: '#000000',
            colorLight: '#ffffff',
            correctLevel: QRCode.CorrectLevel.H
        });

        // 使用 API
        qrcode.clear();
        qrcode.makeCode(webset);
    }

    share();

    function setInvitehan(invitation_type){
        $.ajax({
            url:"/member/city_partner/set_company_invitehan",
            method:"get",
            data:{invitation_type:invitation_type},
            dataType: "json",
            async:false,
            success:function(data){
                if(data.code == 0){
                    if(invitation_type == 'personal'){
                        $('.enterprise').removeClass('dq');
                        $('.personal').addClass('dq');
                    }else{
                        $('.personal').removeClass('dq');
                        $('.enterprise').addClass('dq');
                    }

                    return true;
                }else{
                   return false;
                }
            },
            error:function(){},
        });
    }
    function copy() {
        window.clipboardData.setData("text", website.value)
    }

    //浏览器 复制网址的插件
    function copyUrl2() {
        var Url2 = document.getElementById("biao1");
        Url2.select(); // 选择对象
        document.execCommand("Copy"); // 执行浏览器复制命令
        alert("已复制好，可贴粘。");
    }
    //全局变量，动态的文章ID
        var ShareURL = "";
        //绑定所有分享按钮所在A标签的鼠标移入事件，从而获取动态ID
        $(function () {
            $(".bdsharebuttonbox a").mouseover(function () {
                ShareURL = $(this).attr("data-url");
            });
        });

        /* 
        * 动态设置百度分享URL的函数,具体参数
        * cmd为分享目标id,此id指的是插件中分析按钮的ID
        *，我们自己的文章ID要通过全局变量获取
        * config为当前设置，返回值为更新后的设置。
        */
        function SetShareUrl(cmd, config) {            
            if (ShareURL) {
                config.bdUrl = ShareURL;    
            }
            return config;
        }

        //插件的配置部分，注意要记得设置onBeforeClick事件，主要用于获取动态的文章ID
        window._bd_share_config = {
            "common": {
                onBeforeClick: SetShareUrl, "bdSnsKey": {}, "bdText": ""
                , "bdMini": "2", "bdMiniList": false, "bdPic": "http://assets.jq22.com/plugin/2017-05-24-18-14-49.png", "bdStyle": "0", "bdSize": "24"
            }, "share": {}
        };
        //插件的JS加载部分
        with (document) 0[(getElementsByTagName('head')[0] || body)
            .appendChild(createElement('script'))
            .src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='
            + ~(-new Date() / 36e5)];

</script>
</body>
</html>